package eu.whowie.jast.remote;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class YastServer implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7935855222963125756L;

	List<ModuleGroup> groups = new ArrayList<ModuleGroup>();

	private final String jndiName;
	private final String name;

	/**
	 * 
	 * @param name
	 *            - usualy ip, or fqdn
	 * @param callBackJndiName
	 *            - uniqueue bind name
	 */
	public YastServer(String name, String callBackJndiName) {
		this.name = name;
		jndiName = callBackJndiName;

	}

	public String getName() {
		return name;
	}

	public List<ModuleGroup> getModuleGroups() {
		return this.groups;
	}

	public void setModuleGroup(List<ModuleGroup> moduleGroup) {
		groups.clear();
		groups.addAll(moduleGroup);

	}

	public void setModuleGroup(Collection<ModuleGroup> values) {
		groups.clear();
		groups.addAll(values);

	}

	/**
	 * @return
	 */
	public String getCallBackJNDIName() {
		return jndiName;
	}
}
